package com.titan.domain;

import java.io.Serializable;
import javax.persistence.*;

/**
 * Entity implementation class for Entity: Cruise
 *
 */
@Entity
public class Cruise implements Serializable {

	private static final long serialVersionUID = 1L;
	private int id;
	private String name;
	private Ship ship;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@ManyToOne
	@JoinColumn(name="SHIP_ID")
	public Ship getShip() {
		return ship;
	}
	public void setShip(Ship ship) {
		this.ship = ship;
	}

	public Cruise() {
		super();
	}
	
	@TableGenerator(name="CRUISE_GENERATOR",
			table="GENERATOR_TABLE",
			pkColumnName="PRIMARY_KEY_COLUMN",
			valueColumnName="VALUE_COLUMN",
			pkColumnValue="CRUISE_ID",
			allocationSize=5)
	
	@Id
	@GeneratedValue(strategy=GenerationType.TABLE,generator="CRUISE_GENERATOR")
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
}
